package com.leantech.android.browser.qmui

import androidx.core.view.children
import androidx.recyclerview.widget.RecyclerView
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheetListAdapter


fun QMUIBottomSheet.getBottomSheetListAdapter(): QMUIBottomSheetListAdapter? {
    val adapter = findRecyclerView()?.adapter
    return if (adapter != null && adapter is QMUIBottomSheetListAdapter) adapter else null
}

fun QMUIBottomSheet.findRecyclerView(): RecyclerView? {
    return rootView.children.find {
        it is RecyclerView
    } as? RecyclerView?
}

